﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;

namespace WPF_DataGrid
{
	public partial class MainWindow : Window
	{
		public MainWindow()
		{	
			InitializeComponent();

			InitUsers();
			datagrid.DataContext = UserList;
		}

		private void InitUsers()
		{
			UserList = new List<User>();

			UserList.Add(new User("Hamon", "Benjamin", "toto@gmail.com", EnumGender.Male, true));
			UserList.Add(new User("Lemettre", "Arnaud", "toto@gmail.com", EnumGender.Male, true));
			UserList.Add(new User("Franky", "Toto", "toto43@gmail.com", EnumGender.Male, false));
			UserList.Add(new User("Kerrigan", "Sarah", "swarm@gmail.com", EnumGender.Female, false));
			UserList.Add(new User("Someone", "Helen", "helen@smith.com", EnumGender.Female, false));
		}

		public List<User> UserList { get; private set; }
	}
}
